package br.puc.paa.graph.dijkstra;

import java.io.File;
import java.io.IOException;
import java.net.URISyntaxException;

import br.puc.paa.graph.dijkstra.Dijkstra.EstruturaDeDados;
import br.puc.paa.graph.model.Grafo;
import br.puc.paa.graph.model.Vertice;
import br.puc.paa.graph.util.STPFileUtil;

public class Teste {

	public static void main(String[] args) throws IOException, URISyntaxException {
		
		/*
		 	alue2087.stp, Nodes 1244, Edges 1971
			alue2105.stp, Nodes 1220, Edges 1858
			alue3146.stp, Nodes 3626, Edges 5869
			alue5067.stp, Nodes 3524, Edges 5560
			alue5345.stp, Nodes 5179, Edges 8165
			alue5623.stp, Nodes 4472, Edges 6938
			alue5901.stp, Nodes 3372, Edges 5213
			alue6457.stp, Nodes 3932, Edges 6137
			alue6735.stp, Nodes 4119, Edges 6696
			alue6951.stp, Nodes 2818, Edges 4419
			alue7065.stp, Nodes 34046, Edges 54841
			alue7066.stp, Nodes 6405, Edges 10454
			alue7080.stp, Nodes 34479, Edges 55494
			alue7229.stp, Nodes 940, Edges 1474
			alut0787.stp, Nodes 1160, Edges 2089
			alut0805.stp, Nodes 966, Edges 1666
			alut1181.stp, Nodes 3041, Edges 5693
			alut2010.stp, Nodes 6104, Edges 11011
			alut2288.stp, Nodes 9070, Edges 16595
			alut2566.stp, Nodes 5021, Edges 9055
			alut2610.stp, Nodes 33901, Edges 62816
			alut2625.stp, Nodes 36711, Edges 68117
			alut2764.stp, Nodes 387, Edges 626
			dmxa0296.stp, Nodes 233, Edges 386
			dmxa0368.stp, Nodes 2050, Edges 3676
			dmxa0454.stp, Nodes 1848, Edges 3286
			dmxa0628.stp, Nodes 169, Edges 280
			dmxa0734.stp, Nodes 663, Edges 1154
			dmxa0848.stp, Nodes 499, Edges 861
			dmxa0903.stp, Nodes 632, Edges 1087
			dmxa1010.stp, Nodes 3983, Edges 7108
			dmxa1109.stp, Nodes 343, Edges 559
			dmxa1200.stp, Nodes 770, Edges 1383
			dmxa1304.stp, Nodes 298, Edges 503
			dmxa1516.stp, Nodes 720, Edges 1269
			dmxa1721.stp, Nodes 1005, Edges 1731
			dmxa1801.stp, Nodes 2333, Edges 4137
			teste.stp, Nodes 6, Edges 18 (Exemplo Wikipédia)
		 */
		
		//File file = new File(Teste.class.getClassLoader().getResource("STPFiles/alut2625.stp").getFile());
		File file = new File("/Users/tomaz.alice/Documents/workspace/trabpaa1/src/main/resources/STPFiles/alue2087.stp");
		
		Grafo grafo = STPFileUtil.getGrafo(file);
		
		Vertice fonte = null;
		Vertice destino = null;
		
		for(Vertice vertice : grafo.getVertices()){
			if(vertice.getRotulo().equals("1")){
				fonte = vertice;
			}else if(vertice.getRotulo().equals("88")){
				destino = vertice;
			}
		}
		
		Dijkstra dijkstra = new Dijkstra(grafo, fonte, EstruturaDeDados.ARVORE_BALANCEADA_DE_BUSCA);
		
		dijkstra.imprimaMelhorCaminhoAte(destino);

	}

}
